@ECHO off
ECHO ------------------------------
ECHO Creating "BUILD" Folder
IF EXIST BUILD RMDIR BUILD /S /Q
MD BUILD

ECHO ------------------------------
ECHO Please enter your build option 
ECHO (1) Build with Standard Monitor Wide Icons
ECHO (2) Build with Widescreen Monitor Wide Icons
SET /p SELECTION=Enter the number of your build option and press enter: 

IF "%SELECTION%"=="2" GOTO WIDESCREEN_ICONS
GOTO STANDARD_ICONS

:STANDARD_ICONS
ECHO ------------------------------
ECHO Building with Standard Wide Icons
ECHO ------------------------------

xcopy "Marketplace Icons" "BUILD\Marketplace Icons" /E /Q /I /Y

GOTO LANGUAGE

:WIDESCREEN_ICONS
ECHO ------------------------------
ECHO Building with Widescreen Icons
ECHO ------------------------------

xcopy "Wide Marketplace Icons" "BUILD\Marketplace Icons" /E /Q /I /Y

:LANGUAGE
ECHO ------------------------------
ECHO Choose language :
ECHO   1-English
ECHO   2-German
SET /p lang=Language: 
ECHO ------------------------------

ECHO Copying content..
GOTO MAIN

:MAIN
xcopy "XBMC" "BUILD\XBMC" /E /Q /I /Y
xcopy "*.txt" "BUILD\*.txt" /Q /I /Y

IF %lang%==2 xcopy "languages\German\Translate.xml" "BUILD\XBMC\skin\MC360\PAL" /E /Q /I /Y

GOTO CLEANUP

:CLEANUP
ECHO ------------------------------
ECHO Removing SVN directories from BUILD...
FOR /R BUILD %%d IN (SVN) DO @RD /S /Q "%%d" 2>NUL

ECHO Build Complete - Scroll Up to check for errors.
ECHO ------------------------------
PAUSE